package com.zhaosc.spark.java;

import java.io.Serializable;

public class SortObj implements Serializable,Comparable<SortObj> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4902026684190490641L;
	private Integer temperature;
	private Integer shidu;
	
	
	public SortObj() {
		super();
	}

	public SortObj(Integer temperature, Integer shidu) {
		super();
		this.temperature = temperature;
		this.shidu = shidu;
	}

	public Integer getTemperature() {
		return temperature;
	}

	public void setTemperature(Integer temperature) {
		this.temperature = temperature;
	}

	public Integer getShidu() {
		return shidu;
	}

	public void setShidu(Integer shidu) {
		this.shidu = shidu;
	}

	@Override
	public int compareTo(SortObj o) {
		if(o.getTemperature() - getTemperature() == 0){
			return o.getShidu() - getShidu();
		}else{
			return o.getTemperature() - getTemperature();
		}
	}
}
